a = 'fdsa_sdaf_sdaf'
a.split()
split(a)
split(a, '_')
strsplit(a, '_')
strsplit(a, '_')[1,2]
strsplit(a, '_')[1:2]
strsplit(a, '_')[1]
strsplit(a, '_')[1[1]
strsplit(a, '_')[1][1]
strsplit(a, '_')[1]
strsplit(a, '_')[1][1]
strsplit(a, '_')[[1]]
strsplit(a, '_')[[1]][1:2]
paste(strsplit(a, '_')[[1]][1:2], sep="_")
paste(strsplit(a, '_')[[1]][1:2], collapse = '_')
setwd("C:\\Users\\moydevma\\Dropbox\\PhD\\6_Core_Projects\\2017_watsen\\com\\paper\\figures\\code")
# Import libraries and functions
library(ggplot2)
library(reshape2)
library(readr)
library(dplyr)
library(scales)
source('defaults.R')
dataset_time_series <- read_delim("../data/test_results.txt", ",", escape_double = FALSE, trim_ws = TRUE)
dataset_time_series['multitime'] <- paste(strsplit(dataset_time_series['run'],"_")[[1]][3:5], collapse = '_')
dataset_time_series['multitime'] <- paste(strsplit(dataset_time_series['run'],sep="_")[[1]][3:5], collapse = '_')
dataset_time_series['multitime'] <- paste(strsplit(dataset_time_series['run'],split="_")[[1]][3:5], collapse = '_')
dataset_time_series['multitime'] <- paste(strsplit(dataset_time_series['run',],split="_")[[1]][3:5], collapse = '_')
dataset_time_series['run',]
dataset_time_series['run']
dataset_time_series['multitime'] <- paste(strsplit(dataset_time_series['run'],split="_")[[1]][3:5], collapse = '_')
strsplit(dataset_time_series['run'],split="_")
dataset_time_series['multitime'] <- paste(strsplit(dataset_time_series$run,split="_")[[1]][3:5], collapse = '_')
x = 'asdfa.sdaf.dfas'
lengths(regmatches(x, gregexpr(".", x)))
gregexpr(".", x)
gregexpr("\.", x)
gregexpr("..", x)
library(stringr)
str_count('asd.asd.fa.', '.')
str_count('asd.asd.fa.', '\.')
str_count('asd.asd.fa.', fixed('.'))
dataset_time_series$frame_count <- str_count(dataset_time_series$multitime, fixed('.'))
dataset_time_series$frame_count <- str_count(dataset_time_series$multitime, fixed('.'))+1
dataset_time_series$mode <- strsplit(dataset_time_series$run,split="_")[[1]][8]
dataset_time_series$mode <- strsplit(dataset_time_series$run,split="_")[[1]][10]
dataset <- read_delim("../data/test_results.txt", ",", escape_double = FALSE, trim_ws = TRUE)
# interpret run information
dataset['multitime'] <- paste(strsplit(dataset$run,split="_")[[1]][3:5], collapse = '_')
dataset$frame_count <- str_count(dataset$multitime, fixed('.'))+1
dataset$mode <- strsplit(dataset$run,split="_")[[1]][10]
ggplot(dataset, aes(y = flooding, x = frame_count)) +
geom_boxplot() +
theme_pub_light()
View(dataset_time_series)
strsplit(dataset$run,split="_")[[1]][3:5]
dataset$run
ggplot(dataset, aes(y = flooding, x = frame_count)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
dataset <- read_delim("../data/test_results.txt", ",", escape_double = FALSE, trim_ws = TRUE)
ggplot(dataset, aes(y = flooding, x = frame_count)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(y = flooding, x = num_frames)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(y = flooding, group = num_frames)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(flooding, num_frames)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding)) +
geom_boxplot(aes(group = num_frames)) +
geom_jitter() +
theme_pub_light()
View(dataset)
dataset <- read_delim("../data/test_results.txt", ",", escape_double = FALSE, trim_ws = TRUE)
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot(aes(group = num_frames)) +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot(aes(group = num_frames, fill=mode)) +
geom_jitter() +
theme_pub_light()
toString(2)
ggplot(dataset, aes(toString(num_frames), flooding, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
dataset$num_frames <- as.factor(dataset$num_frames)
dataset$mode <- as.factor(dataset$mode)
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, all_classes, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
dataset <- read_delim("../data/test_results.txt", ",", escape_double = FALSE, trim_ws = TRUE)
# factorize
dataset$num_frames <- as.factor(dataset$num_frames)
dataset$mode <- as.factor(dataset$mode)
ggplot(dataset, aes(num_frames, all_classes, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
geom_jitter(width = 0.3) +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
geom_jitter(width = 0.3, aes(fill=mode)) +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
geom_jitter(width = 0.3, color=mode) +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
dataset <- read_delim("../data/test_results.txt", ",", escape_double = FALSE, trim_ws = TRUE)
dataset$num_frames <- as.factor(dataset$num_frames)
dataset$mode <- as.factor(dataset$mode)
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
ggplot(dataset, aes(num_frames, all_classes, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
ggsave(filename = "Fig4.png", path = "../generated plots",
width = 85, height = 55, units = 'mm', dpi = 600)
ggsave(filename = "Fig4.png", path = "../generated plots",
width = 85, height = 55, units = 'mm', dpi = 600)
ggplot(dataset, aes(num_frames, flooding, fill=mode)) +
geom_boxplot() +
# geom_jitter() +
theme_pub_light()
ggsave(filename = "Fig4.png", path = "../generated plots",
width = 85, height = 55, units = 'mm', dpi = 600)
data1 = read_delim("G:\watson_eval\8_compute_index\cam1_intra_0_0.2_0.4__ly4ftr16__cam1_0_0.2_0.4.csv")
data1 = read_delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__cam1_0_0.2_0.4.csv")
setwd("C:\\Users\\moydevma\\Dropbox\\PhD\\6_Core_Projects\\2017_watsen\\com\\paper\\figures\\code")
library(ggplot2)
library(reshape2)
library(readr)
library(dplyr)
library(scales)
library(stringr)
source('defaults.R')
data1 = read_delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__cam1_0_0.2_0.4.csv")
data1 = read_delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__cam1_0_0.2_0.4.csv", ',')
data5 = read_delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__cam5_0_0.2_0.4.csv", ',')
datag = read.delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__gopro1_0_0.2_0.4.csv", ',')
ggplot(data1, aes(y = sensor_value, x = datetime)) +
geom_bar(stat='identity', fill='dodgerblue4') +
scale_x_datetime(name='Time') +
scale_y_continuous(name = 'Estimated water level [mm]', limits = c(-20, 600)) +
annotate('rect', xmin = as.POSIXct('2016/10/06 12:54'), xmax = as.POSIXct('2016/10/06 13:06'),
ymin = -20, ymax = 40, color='red', fill='transparent') +
annotate('rect', xmin = as.POSIXct('2016/10/06 14:23'), xmax = as.POSIXct('2016/10/06 14:32'),
ymin = -20, ymax = 40, color='red', fill='transparent') +
theme_pub_light()
data1$datetime = strptime(data1$datetime, format="%y%m%D_%H%M%S")
data1 = read_delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__cam1_0_0.2_0.4.csv", ',')
data1['datetime2'] = strptime(data1$datetime, format="%y%m%D_%H%M%S")
data1['datetime2'] = strptime(x=data1$datetime, format="%y%m%D_%H%M%S")
data1['datetime2'] = strptime(x=c(data1$datetime), format="%y%m%D_%H%M%S")
data1['datetime2'] = strptime(x=data1$datetime[[1]], format="%y%m%D_%H%M%S")
data1$datetime
strptime('161007_112511', "%y%m%D_%H%M%S")
strptime('161007_112511', "%y%m%d_%H%M%S")
data1['datetime2'] = strptime(x=data1$datetime, format="%y%m%d_%H%M%S")
strptime(c('161007_112511'), "%y%m%d_%H%M%S")
strptime(c('161007_112511', '161007_112512'), "%y%m%d_%H%M%S")
data1$datetime2 = strptime(x=data1$datetime, format="%y%m%d_%H%M%S")
data1 = read_delim("G:/watson_eval/8_compute_index/cam1_intra_0_0.2_0.4__ly4ftr16__cam1_0_0.2_0.4.csv", ',')
data1$datetime2 = strptime(x=data1$datetime, format="%y%m%d_%H%M%S")
data1$datetime = strptime(x=data1$datetime, format="%y%m%d_%H%M%S")
ggplot(data1, aes(y = sensor_value, x = datetime)) +
geom_bar(stat='identity', fill='dodgerblue4') +
scale_x_datetime(name='Time') +
scale_y_continuous(name = 'Estimated water level [mm]', limits = c(-20, 600)) +
annotate('rect', xmin = as.POSIXct('2016/10/06 12:54'), xmax = as.POSIXct('2016/10/06 13:06'),
ymin = -20, ymax = 40, color='red', fill='transparent') +
annotate('rect', xmin = as.POSIXct('2016/10/06 14:23'), xmax = as.POSIXct('2016/10/06 14:32'),
ymin = -20, ymax = 40, color='red', fill='transparent') +
theme_pub_light()
ggplot(data1, aes(y = sensor_value, x = datetime)) +
geom_bar(stat='identity', fill='dodgerblue4') +
scale_x_datetime(name='Time') +
scale_y_continuous(name = 'Estimated water level [mm]', limits = c(-20, 600)) +
theme_pub_light()
ggsave(filename = "Fig6.png", path = "../generated plots",
width = 85, height = 55, units = 'mm', dpi = 600)
ggplot(data1, aes(y = sensor_value, x = datetime)) +
geom_bar(stat='identity', fill='dodgerblue4', width=1) +
scale_x_datetime(name='Time') +
scale_y_continuous(name = 'Estimated water level [mm]', limits = c(-20, 600)) +
theme_pub_light()
